<div ng-include="sys_html('layout/_header')"></div>
<div class="ncm-container">
    <div ng-include="sys_html('layout/member/left-layout')"></div> 
    <div ng-if="pagedata.op=='main'" class="right-layout">
		 <div class="wrap">
				<div ng-include="sys_html('layout/member/tabmenu')"></div> 
				<div class='fui-content' >
					<div class='content-empty' ng-if="!pagedata.list || pagedata.list.length<1">
						<i class='icon icon-location'></i>
						<br/>You don't have any shipping address
					</div>
				
				<div ng-repeat="address in pagedata.list" class="fui-list-group address-item" style='margin-top:0.5rem;'
					 data-addressid="{{address.id}}">
					<div  class="fui-list" >
						<div class="fui-list-inner">
							<div class="title"><span class='realname'>{{address.name}}</span> <span class='mobile'>{{address.mobile}}</span></div>
							<div class="text">
								<span class='address'>{{address.address}} {{address.pcd.district}} {{address.pcd.city}} {{address.pcd.province}} {{address.pcd.countries}}</span>
							</div>
							<div class='bar' >
								<span class='pull-right'>
									<a href="javascript:;" ng-click="access_json('/member.address/post/id='+address.id)"  data-nocache="true">
										<i class='icon icon-edit2'></i> edit
									</a>
									&nbsp;&nbsp;
									<a href="javascript:;" ng-click="post({},'/member.address/del/id='+address.id)" data-toggle='delete' class='external'>
									<i class='icon icon-delete'></i> delete
									</a>
								</span>

								<label class='radio-inline'>
									<input type="radio" name='setdefault' data-toggle='setdefault' ng-click="post({},'/member.address/set/id='+address.id)" class="fui-radio fui-radio-danger" ng-checked="address.isdefault==1" /> set default
								</label>
							</div>
						</div>
					</div>
				</div>
				
			</div>
			<a  ng-click="access_json('/member.address/post/')"  class="btn  btn-danger-o btn-edit" ><i class="icon icon-add"></i> add address</a>
		</div>
	</div>
	<div class="right-layout" ng-if="pagedata.op=='post'">
			<div method='post'  class='form-ajax' style="margin:10px">
				<div ng-include="sys_html('layout/member/tabmenu')"></div> 
						<input type='hidden' id='addressid' value="{{pagedata.address.id}}"/>
						<div class='fui-cell-group'>
							<div class='fui-cell'>
								<div class='fui-cell-label'>Realname</div>
								<div class='fui-cell-info'><input type="text" id='realname'  name='name' ng-model="pagedata.address.name" placeholder="recipient" class="fui-input"/></div>
							</div>
							<div class='fui-cell'>
								<div class='fui-cell-label'>Mobile</div>
								<div class='fui-cell-info'><input type="tel" id='mobile' name='mobile' ng-model="pagedata.address.mobile" placeholder="mobile"  class="fui-input"/></div>
							</div>
							<div class='fui-cell'>
								<div class='fui-cell-label'>Country/Region</div>
								<div class='fui-cell-info'>
									<select style="padding:0.3rem" name="province" ng-model="pagedata.address.pcd.province">
										<option ng-repeat="q in pagedata.countries" value="{{q.en_title}}">{{q.en_title}}</option>
									</select>
								</div>
							</div>
							<div class='fui-cell'>
								<div class='fui-cell-label'>City</div>
								<div class='fui-cell-info'><input type="text" ng-model="pagedata.address.pcd.city" placeholder="city" class="fui-input"/></div>
							</div>
							<div class='fui-cell'>
								<div class='fui-cell-label'>District</div>
								<div class='fui-cell-info'><input type="text" ng-model="pagedata.address.pcd.district" placeholder="district" class="fui-input"/></div>
							</div>
							<div class='fui-cell'>
								<div class='fui-cell-label'>Detailed address</div>
								<div class='fui-cell-info'><input type="text" id='address' name='address' ng-model="pagedata.address.address" placeholder='Street, building brand, etc'  class="fui-input"/></div>
							</div>
						</div>
						<a id="btn-submit" ng-click="post(pagedata.address,'save')" class='external btn btn-danger block'>Save the address</a>
			</div>
	</div>
</div>
<div ng-include="sys_html('layout/_footer')"></div>
<script>
</script>